import { GET, POST } from '../index';

// mcp分页
export const pageMcp = (data: any) => {
  return POST(`/api/v2/serve/mcp_component/_page?page=${data.page || 1}&page_size=${data.page_size || 12}`, data);
};
// 全部mcp
export const listMcp = (data: any) => {
  return POST('/api/v2/serve/mcp_component/list', data);
};

/**
 *  创建
 */
export const addMcp = (data: any) => {
  return POST('/api/v2/serve/mcp_component/add', data);
};
/**
 *  更新
 */
export const updateMcp = (data: any) => {
  return POST('/api/v2/serve/mcp_component/update', data);
};
/**
 *  删除
 */
export const delMcp = (data: any) => {
  return POST('/api/v2/serve/mcp_component/delete', data);
};
/**
 *  校验地址
 */
export const connect_testMcp = (data: any) => {
  return POST(`/api/v2/serve/mcp_component/connect_test?type=${data.type}&server_url=${data.server_url}`, data);
};
/**
 *  基本信息
 */
export const queryMcp = (data: any) => {
  return POST('/api/v2/serve/mcp_component/get', data);
};

/**
 *  mcp资源，工具等数据
 */
export const resourceMcp = (data: any) => {
  return POST('/api/v2/serve/mcp_component/list_mcp_resource', data);
};